<!-- 记录订单列表内容，订单列表和会员详情页共用 -->
<div class="rightinfo">
    <div class="tools">
        <ul class="toolbar1">
        	<form action="/order/info/infos.html" method="post">
	        	<span>
	        		<input name="code" class="scinput" type="text" value="${(order.code)!""}" autocomplete="off" placeholder="订单编号">
	        		<input name="userId" class="scinput" type="text" value="${(order.userId)!""}" autocomplete="off" placeholder="下单用户ID">
	        		<input name="userName" class="scinput" type="text" value="${(order.userName)!""}" autocomplete="off" placeholder="下单用户名">
	        		<input name="contacts" class="scinput" type="text" value="${(order.contacts)!""}" autocomplete="off" placeholder="联系人">
	        		<input name="phone" class="scinput" type="text" value="${(order.phone)!""}" autocomplete="off" placeholder="联系人电话">
	        		
			    	<select class="select3" name="orderSource" style="width: 100px;">
					    <option value="">选择订单来源</option>
					    <#if sources??><#list sources as item>
					    <option value=${item.val} <#if (order.orderSource)?? && (order.orderSource)?number ==item.val>selected="selected"</#if>>${(item.text)!""}</option>
				        </#list></#if>
				    </select>
	        		<select class="select3" name="status" style="width: 100px;" <#if op?? && op="view">disabled=true</#if>>
					    <option value="">选择状态</option>
					    <#if status??><#list status as item>
					    <option value=${item.val} <#if (order.status)?? && (order.status)?number == item.val>selected="selected"</#if>>${(item.text)!""}</option>
					    </#list></#if>
				    </select>
			    	<input type="submit" class="scbtn" value="查询"/>
	        	</span>
    		</form>
        </ul>
    </div>
       
   	<table class="tablelist">
    	<thead>
	    	<tr>
		        <th width="3%"><input  type="checkbox" class="check_box" id="allChk"></input></th>
		        <th width="10%">用户名</th>
		        <th width="12%">订单编号</th>
		        <th width="10%">订单金额</th>
		        <th width="10%">支付金额</th>
		        <th width="7%">状态</th>
		        <th width="12%">下单时间</th>
		        <th width="5%">联系人</th>
		        <th width="9%">联系电话</th>
		        <th width="5%">来源</th>
		        <th width="15%">操作</th>
	        </tr>
        </thead>
        <tbody>
        <#if orders?? && orders?size gt 0>
  		<#list orders as item>
			<tr>
		        <td><input type="checkbox" class="check_box" name="colChk" value=${(item.id)!0}></input></td>
		        <td>${(item.userName)!"--"}</td>
		        <td><a href="/order/info/view/${item.id}.html">${(item.code)!"--"}</a></td>
		        <td>&yen;${((item.amountTotal)!0)?string('0.00')}</td>
		        <td><#if item.amountPay??>&yen;${((item.amountPay)!0)?string('0.00')}<#else>--</#if></td>
		        <td>${(item.statusName)!"--"}</td>
		        <td><#if item.orderTime?exists>${(item.orderTime)?string("yyyy-MM-dd HH:mm:ss")}<#else>--</#if></td>
		        <td>${(item.contacts)!"--"}</td>
		        <td>${(item.phone)!"--"}</td>
		        <td>
		        <#if sources??><#list sources as source>
		        <#if source.val == item.orderSource>${(source.text)!"--"}</#if>
		        </#list></#if>
				</td>
		        <td>
		        	<a href="/order/info/view/${item.id}.html">查看</a>
					<!-- 根据不同状态显示不同按钮，此处js和列表页面共用 -->
				 	<#if item.status == 2>&ensp;|&ensp;
				 	<a href="javascript:void(0);" name="modifyStatusBtn" orderId=${item.id} nextStatus="SENT" op="SEND" >发货</a>&ensp;|&ensp;
				 	<a href="javascript:void(0);" name="modifyStatusBtn" orderId=${item.id} nextStatus="REFUND_APPLY" op="REFUND" >退款</a>
				 	<#elseif item.status==3>&ensp;|&ensp;
				 	<a href="javascript:void(0);" name="modifyStatusBtn" orderId=${item.id} nextStatus="COMPLETED" op="COMPLETE" >完成</a>&ensp;|&ensp;
				 	<a href="javascript:void(0);" name="modifyStatusBtn" orderId=${item.id} nextStatus="REFUND_GOODS" op="REFUND_GOODS" >退货</a>
				 	<#elseif item.status==7>&ensp;|&ensp;
				 	<a href="javascript:void(0);" name="modifyStatusBtn" orderId=${item.id} nextStatus="REFUNDING" op="AUDIT_REFUND" >同意</a>&ensp;|&ensp;
				 	<a href="javascript:void(0);" name="modifyStatusBtn" orderId=${item.id} nextStatus="REFUND_FAIL" op="AUDIT_REFUND" >拒绝</a>
				 	<#elseif item.status==8>&ensp;|&ensp;
				 	<a href="javascript:void(0);" name="modifyStatusBtn" orderId=${item.id} nextStatus="REFUNDED" op="RIMIT" >打款</a>&ensp;|&ensp;
				 	<a href="javascript:void(0);" name="modifyStatusBtn" orderId=${item.id} nextStatus="REFUND_FAIL" op="COMPLETE" >拒绝</a>
				 	<#elseif item.status==11>&ensp;|&ensp;
				 	<a href="javascript:void(0);" name="modifyStatusBtn" orderId=${item.id} nextStatus="REFUNDING_GOODS" op="AUDIT_REFUND_GOODS" >同意</a>&ensp;|&ensp;
				 	<a href="javascript:void(0);" name="modifyStatusBtn" orderId=${item.id} nextStatus="REFUND_GOODS_FAIL" op="AUDIT_REFUND_GOODS" >拒绝</a>
				 	<#elseif item.status==12>&ensp;|&ensp;
				 	<a href="javascript:void(0);" name="modifyStatusBtn" orderId=${item.id} nextStatus="REFUND_APPLY" op="REFUND" >退款</a>&ensp;|&ensp;
				 	<a href="javascript:void(0);" name="modifyStatusBtn" orderId=${item.id} nextStatus="REFUND_GOODS_FAIL" op="COMPLETE" >拒绝</a>
				 	</#if>
		        </td>
	        </tr> 
  		</#list>
		<#else>
		<tr><td colspan="11" class="table-nodata">没有找到数据！</td></tr>
	  	</#if>
        </tbody>
    </table>
  		<#import "/common/pager.ftl" as page>
	<#if count??>
		<@page.pager start=start size=size count=count url="/order/info/infos.html?t=admin" gotoPage=true />
	</#if>
</div>
<#include "/common/orderStatusTipLayer.html">

<script type="text/javascript" src="/js/jquery-1.10.1.min.js"></script>
<script type="text/javascript" src="/js/commonList.js"></script>
<script type="text/javascript" src="/js/biz/orderStatusTipLayer.js"></script>